package ui.panels.additionalSettings;

import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JFrame;

import ui.flowManager.FlowManagerImpl;

/**
 * @author vladimir && alon
 * Frame of Additional Settings
 *
 */
public class AdditionalSettingsFrame extends JFrame{
	
	public AdditionalSettingsFrame()
	{
		super();
        this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        this.setSize(400,300);
        this.setResizable(false);
        //This will center the JFrame in the middle of the screen
        this.setLocationRelativeTo(null);
        this.setVisible(true);
        
        //disable the the primary GUI
        FlowManagerImpl.getInstance().setEnable(false);
        
        //set listener to close
        this.addWindowListener(new WindowEventHandler());

	}

	private class WindowEventHandler extends WindowAdapter {
		  public void windowClosing(WindowEvent evt) { 
		    //set enable the primary GUI
			 FlowManagerImpl.getInstance().setEnable(true);
		  }
	}

}
